package cn.touna.jss.spring;

import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.*;

/**
 * @Author:wuwc
 * @Description:
 * @Date:2018/2/11 10:37
 */
@SpringBootTest
public class BlackListUtil {


    @Test
    public void testBlackList() {
        BufferedReader buff = null;
        StringBuilder result = new StringBuilder();
        try {
            //File file = new File("D:\\work\\blacklist.txt");
            buff = new BufferedReader(new InputStreamReader(new FileInputStream("D:\\work\\blacklist.txt"), "UTF-8"));
            String line = null;
            while ((line = buff.readLine()) != null) {
                result.append(line.replace("\r", "").replace("\t", ""));
                System.out.println(result);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (buff != null) {
                try {
                    buff.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
